package com.practice.util;

import java.util.ArrayList;

public class Node {
	private int n;
	private ArrayList<Node> children;
	
	public Node(int n) {
		this.n = n;
		this.children = new ArrayList<Node>();
	}
	
	public int value() {
		return this.n;
	}
	
	public ArrayList<Node> getChildren() {
		return this.children;
	}
	
	public void addNode(Node node) {
		this.children.add(node);
	}
	
	public void addNodes(Node... nodes) {
		for (Node node : nodes) {
			addNode(node);
		}
	}
	
	public void addNodes(int... values) {
		for (int value : values) {
			addNode(new Node(value));
		}
	}
}
